package com.lxz.shardingjdbcdemo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lxz.shardingjdbcdemo.model.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderMapper extends BaseMapper<Order> {

    // 自定义查询方法，也可以使用BaseMapper的方法如selectList、selectById等
    @Select("SELECT order_id, user_id, order_no, amount FROM t_order WHERE user_id = #{userId}")
    List<Order> findByUserId(@Param("userId") Integer userId);
}